home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Misc / RZToDoList / Source / FullCopyList.m < prev    next >
Encoding:
Text File  |  1995-06-12  |  1.0 KB  |  45 lines

  1. /* 
  2.  * FullCopyList - watch it sizzle!  A highly transportable List subclass!
  3.  *
  4.  * You may freely copy, distribute and reuse the code in this example.
  5.  * This code is provided AS IS without warranty of any kind, expressed 
  6.  * or implied, as to its fitness for any particular use.
  7.  *
  8.  * Copyright 1995 Ralph Zazula (rzazula@next.com).  All Rights Reserved.
  9.  *
  10.  */
  11.  
  12. #import "FullCopyList.h"
  13.  
  14. @implementation FullCopyList
  15.  
  16. - encodeUsing:(id <NXEncoding>)portal 
  17. {
  18.     int i, n = [self count];    
  19.     [portal encodeData:&n ofType:"i"];
  20.     for (i = 0; i < n; i++)
  21.         [portal encodeObjectBycopy:[self objectAt:i]];
  22.     return self;
  23. }
  24.  
  25. - decodeUsing:(id <NXDecoding>)portal 
  26. {
  27.     int i, n;
  28.     [portal decodeData:&n ofType:"i"];
  29.     [self initCount:n];
  30.     for (i = 0; i < n; i++)
  31.         [self addObject:[portal decodeObject]];
  32.     return self;
  33. }
  34.  
  35. - encodeRemotelyFor:(NXConnection *)connection
  36.     freeAfterEncoding:(BOOL *)flagp
  37.     isBycopy:(BOOL)isBycopy
  38. {
  39.     /* always jump across the wire */
  40.     *flagp = YES;
  41.     return self;
  42. }
  43.  
  44. @end
  45.